define(["jquery", "easy-admin"], function ($, ea) {

    var form = layui.form;
    var active = {
        listen: function () {
            layui.util.event('lay-active', {
                delete_item: function(data){
                    $(this).parent().remove();
                },
                add_item: function(data){
                    var html = $('#item_tpl').html();
                    $('#content_i').append(html);

                    layui.form.render('select')
                }
            })
        }
    };
    return {
        index: function () {
            var _group = 'site'

            form.on("submit", function (data) {
                data.field['group'] = _group
            });

            active.listen();

            ea.listen('', function (res) {
                ea.msg.success(res.msg);
            }, function (err) {
                ea.msg.error(err.msg);
            });
        }
    };
});